import React, { Component } from 'react'

import PropTypes from 'prop-types';

export default class PropsList extends Component {
    render () {
        return (
            <div>PropsList
                {this.props.name}
                <hr />
                {this.props.num + 100}
            </div>
        )
    }
}
PropsList.propTypes = {
    num: PropTypes.number.isRequired,
    msg: PropTypes.string.isRequired,
    list: PropTypes.array,
    obj: PropTypes.shape({
        userName: PropTypes.string,
        age: PropTypes.number,
        sex: PropTypes.string.isRequired
    })

}
// 指定 props 的默认值：
PropsList.defaultProps = {
    name: '我是默认值'
};


